package com.heima.model.user.pojos;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @author huan
 * @serial 每天一百行, 致敬未来的自己
 * @Description
 */

@Data
@TableName("ap_user")
public class ApUser implements Serializable {

    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 密码、通信等加密盐
     */
    @TableField("salt")
    private String salt;
    /**
     * 用户名
     */
    @TableField("name")
    private String name;
    /**
     * 密码,md5加密
     */
    @TableField("password")
    private String password;
    /**
     * 手机号
     */
    @TableField("phone")
    private String phone;
    /**
     * 头像
     */
    @TableField("image")
    private String image;
    /**
     * 0 男
     * 1 女
     * 2 未知
     */
    @TableField("sex")
    private Boolean sex;
    /**
     * 0 未
     * 1 是
     */
    @TableField("is_certification")
    private Boolean certification;
    /**
     * 是否身份认证
     */
    @TableField("is_identity_authentication")
    private Boolean identityAuthentication;
    /**
     * 0正常
     * 1锁定
     */
    @TableField("status")
    private Boolean status;
    /**
     * 0 普通用户
     * 1 自媒体人
     * 2 大V
     */
    @TableField("flag")
    private Short flag;
    /**
     * 注册时间
     */
    @TableField("created_time")

    private Date createdTime;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof ApUser)) return false;
        ApUser apUser = (ApUser) o;
        return Objects.equals(id, apUser.id) && Objects.equals(salt, apUser.salt) && Objects.equals(name, apUser.name) && Objects.equals(password, apUser.password) && Objects.equals(phone, apUser.phone) && Objects.equals(image, apUser.image) && Objects.equals(sex, apUser.sex) && Objects.equals(certification, apUser.certification) && Objects.equals(identityAuthentication, apUser.identityAuthentication) && Objects.equals(status, apUser.status) && Objects.equals(flag, apUser.flag) && Objects.equals(createdTime, apUser.createdTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, salt, name, password, phone, image, sex, certification, identityAuthentication, status, flag, createdTime);
    }

}